package com.dao;

import com.domain.Document;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Date;

@Repository("documentDao")
public interface DocumentDao {

    //显示所有附件信息
    public List<Document> showDocument(@Param("space_id")int space_id);

    //分页显示
    public List<Document> findAllFileByPage(@Param("space_id")int space_id,@Param("from")int from,@Param("pageSize")int pageSize);

    //根据资源id显示附件信息
    public List<Document> showDocumentByResourceId(@Param("id")Integer id);

    public List<Document> showDocumentById(@Param("id")Integer id);

    //新建文件信息
    public Integer insertDocument(@Param("filename")String filename,@Param("filesize") double filesize,
                                  @Param("createdate") Date createdate,@Param("downloadcount") Integer downloadcount,
                                  @Param("member_id")Integer member_id,@Param("resource_id")Integer resource_id,@Param("contribute_id")Integer contribute_id,@Param("space_id")Integer space_id);

    //根据id删除附件
    public Integer deleteFile(@Param("id")Integer id);

    //修改下载次数
    public Integer updateNum(@Param("id")Integer id,@Param("downloadcount") Integer downloadcount);
}
